<template>
	
	<view>
		<u-list @scrolltolower="scrolltolower" v-if="propLoglist.length != 0">
			<u-list-item v-for="(item, index) in propLoglist" :key="index">
				<view class="conter_box">
					<view class="download_box">
						<image :src="imgUrl + item.image" mode=""></image>
						<view class="login_box">
							<view class="">道具名称：{{ item.propName }}</view>
							<view class="">
								道具来源：
								<text>{{item.channelName}}</text>
							</view>
						</view>
						<view :class="item.type == 1 ? 'integer_box' : 'common'">
							<view>{{ item.type == 1 ? '新增' : '扣除' }}数量：{{ item.value }}</view>
							<view style="margin-top: 5rpx;">
								{{ item.createTime }}
							</view>
						</view>
					</view>
				</view>
			</u-list-item>
		</u-list>
		<view v-if="propLoglist.length == 0">
			<image style="
			width: 280rpx;
			height: 280rpx;
			margin: 270rpx 220rpx 0;
			" src="../../static/images/fighting.gif" mode=""></image>
		</view>
	</view>
	
</template>

<script>
import { propLog } from '@/api/hassold/hassold.js';
import config from '@/config.js';
export default {
	data() {
		return {
			page: 1,
			size: 10,
			totalSize: 0,
			imgUrl: config.gillUrl,
			propLoglist: []
		};
	},
	created() {
		this.getpropLog();
	},
	methods: {
		async getpropLog() {
			let param = {};
			param.page = this.page;
			param.size = this.size;
			const data = await propLog(param);
			let _this = this;
			data.data.pageData.map((i) => {
				_this.propLoglist.push(i);
			});
			// console.log(data, 'ppp');
			this.totalSize = data.data.totalSize;
		},
		scrolltolower() {
			//加载时候判断是否还有下一页
			if (this.propLoglist.length < this.totalSize) {
				this.page++;
				//则还有下一页
				this.getpropLog();
			} else {
				this.page = 1;
			}
		}
	}
};
</script>

<style lang="scss" scoped>
.Abouts {
	width: 680rpx;
	margin: 300rpx 17rpx;
	padding-left: 8%;
}
.common {
	view:nth-child(2) {
		padding: 27rpx 0 0 0;
	}
	view:nth-child(1) {
		color: red;
	}
}
.conter_box {
	padding: 34.88rpx 0 0 34.88rpx;
	.download_box {
		width: 680rpx;
		height: 140rpx;
		padding: 20rpx;
		font-size: 26rpx;
		font-weight: 400;
		color: #ffffff;
		border-radius: 14rpx;
		display: flex;
		background-color: #15142d;
		justify-content: space-between;
		font-family: 'font';
		image {
			width: 100rpx;
			height: 100rpx;
			border-radius: 14rpx;
		}
		.login_box {
			view:nth-child(2) {
				padding: 25rpx 0 0 0;
			}
		}

		.integer_box {
			view:nth-child(2) {
				padding: 27rpx 0 0 0;
			}
		}
	}
}
</style>
